Skip to content

feat: add terminal session monitoring and AI audit - #4725

Open
huanghongbo-hhb wants to merge 26 commits into
koderover:mainfrom
huanghongbo-hhb:feat/terminal-session-audit
Open

feat: add terminal session monitoring and AI audit#4725
huanghongbo-hhb wants to merge 26 commits into
koderover:mainfrom
huanghongbo-hhb:feat/terminal-session-audit

Conversation

@huanghongbo-hhb

@huanghongbo-hhb huanghongbo-hhb commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add terminal session recording, live monitoring, replay, termination, and AI security audit.

Main Changes

  • Capture pod exec, workflow debug, and SSH terminal sessions as asciicast with MongoDB command metadata.
  • Broadcast stdout to spectators across replicas and keep recording independent from slow observers.
  • Build redacted, bounded AI evidence; cap analysis to the first 500 commands and 20 chunks and mark truncation as partial.
  • Guard concurrent AI runs with leases and persist model, coverage, counts, findings, and failure state.

Risk / Compatibility

  • Adds system APIs and MongoDB collections/indexes; the existing terminal command list remains descending by default.
  • Live monitoring is best effort and does not block terminal recording or object storage.

Test

  • go build ./pkg/shared/terminalaudit ./pkg/microservice/aslan/core/system/service ./pkg/microservice/aslan/core/system/handler ./pkg/microservice/podexec/core/service
  • Targeted evidence/chunk boundary cases verified locally; test files are not included.

Contact


This change is Reviewable

@huanghongbo-hhb
huanghongbo-hhb force-pushed the feat/terminal-session-audit branch 3 times, most recently from b31f718 to 2114627 Compare June 1, 2026 02:11
@landylee007
landylee007 requested a review from leozhang2018 July 31, 2026 10:16
@huanghongbo-hhb
huanghongbo-hhb force-pushed the feat/terminal-session-audit branch from 69c38e5 to 35f6012 Compare August 13, 2026 05:38
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
This reverts commit 30da675.

Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Stream active sessions across replicas and fail terminal initialization when audit setup cannot complete.

Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Build a bounded prompt from the asciicast evidence, call the configured
LLM as a command security auditor, and persist structured audit results.

Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
Signed-off-by: huanghongbo-hhb <huanghongbo@koderover.com>
@huanghongbo-hhb
huanghongbo-hhb force-pushed the feat/terminal-session-audit branch from c228982 to 1ad469b Compare August 18, 2026 02:28
@huanghongbo-hhb huanghongbo-hhb changed the title feat: add terminal session audit feat: add terminal session monitoring and AI audit Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant